package pl.zmudzinski.adapter.example1.duck;

import com.google.inject.AbstractModule;
import com.google.inject.Scopes;
import com.google.inject.Provider;
import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when;
import pl.zmudzinski.adapter.example1.turkey.Turkey;
import pl.zmudzinski.adapter.example1.turkey.TurkeyAdapter;

/**
 * @author lukasz.zmudzinski
 */
public class TurkeyAdapterTestModule extends AbstractModule{
    protected void configure() {
        bind(Turkey.class).to(TurkeyAdapter.class).in(Scopes.SINGLETON);
        bind(Duck.class).toProvider(new Provider<Duck>(){
            public Duck get() {
                Duck mock = mock(Duck.class);
                when(mock.kwack()).thenReturn("kwack");
                return mock;
            }
        });
    }
}
